test: more link-shape variants of subtokenize.rs:149 panic (GH-79)#207
Open
ChristianMurphy wants to merge 1 commit intowooorm:test/link-with-titlefrom
Open
Conversation
…H-79) Adds 2 input-shape variants of the chain-walker panic at `src/subtokenize.rs:149` ("expected link") that this PR already covers with `[](a (a \n))`. Both new shapes hit the same `expect` on an event whose `link` field is `None`, but reach it via different construct paths: * `[x](/x "> \n")` — inline link with quoted title containing a bare `>` followed by a newline. 13 bytes, hand-reduced from a 39-byte fuzzed input. * `[][a \n]\n\n[a ]:\0` — collapsed-reference link `[][...]` whose label contains a space-newline pair, with a definition whose URL is a NUL byte. 15 bytes. Both panic at the same site in 1.0.0 release. The single chain-builder integrity fix that closes this PR's case (`[](a (a \n))`) is likely to close all three together: in each case `attention.rs` produces an event with `link: None` (lines 364–413) that gets spliced into the `label_end.rs` link-content chain consumed by `subtokenize::call`. Verified to fail against `markdown = "=1.0.0"` in release. Use the weaker `matches!(_, Ok(_))` assertion since the spec-correct HTML output for these inputs is not load-bearing for what this test demonstrates — only that the call returns rather than panics. Found via in-tree fuzzing campaign. Related-to: wooormGH-79.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds 2 input-shape variants of the chain-walker panic at
src/subtokenize.rs:149("expected link") that this PR already covers with[](a (a \n)). Both new shapes hit the sameexpecton an event whoselinkfield isNone, but reach it via different construct paths:[x](/x "> \n")— inline link with quoted title containing a bare>followed by a newline. 13 bytes, hand-reduced from a 39-byte fuzzed input.[][a \n]\n\n[a ]:\0— collapsed-reference link[][...]whose label contains a space-newline pair, with a definition whose URL is a NUL byte. 15 bytes.Both panic at the same site in 1.0.0 release. The single chain-builder integrity fix that closes this PR's case (
[](a (a \n))) is likely to close all three together: in each caseattention.rsproduces an event withlink: None(lines 364–413) that gets spliced into thelabel_end.rslink-content chain consumed bysubtokenize::call.Verified to fail against
markdown = "=1.0.0"in release. Use the weakermatches!(_, Ok(_))assertion since the spec-correct HTML output for these inputs is not load-bearing for what this test demonstrates — only that the call returns rather than panics.Found via in-tree fuzzing campaign.
Related-to: GH-79.